﻿@model ProductDetailsModel
@using Nop.Core.Domain.Seo;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title, meta
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var productUrl = Url.RouteUrl("Product", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(productUrl);
    }
}
<!--product breadcrumb-->
@Html.Partial("_ProductBreadcrumb", Model.Breadcrumb)



<div class="features_items"><!--features_items-->
    <h2 class="title text-center">@Model.Name</h2>

    
    <div class="product-details">
        @using (Html.BeginRouteForm("Product", new { SeName = Model.SeName }, FormMethod.Post, new { id = "product-details-form" }))
        {
            <div itemscope itemtype="http://schema.org/Product" data-productid="@Model.Id">
                <div class="product-essential">
                    @Html.Widget("productdetails_before_pictures")
                    <!--product pictures-->
                    <div class="row">
                        
                    
                        <div class="col-md-5">
                            @Html.Partial("_ProductDetailsPictures", Model)
                            @Html.Widget("productdetails_after_pictures")
                        </div>
                        <div class="col-md-7 overview">
                            <div class="product-information">
                                @if (!String.IsNullOrEmpty(Model.ShortDescription))
                                {
                                    <div class="short-description">
                                        @Html.Raw(Model.ShortDescription)
                                    </div><br/>
                                }
                        
                                <!--product manufacturers-->
                                @Html.Partial("_ProductManufacturers", Model.ProductManufacturers)
                                <!--product reviews-->
                                @Html.Partial("_ProductReviewOverview", Model.ProductReviewOverview)
                               @Html.Partial("_ProductEmailAFriendButton", Model)
                                @Html.Partial("_CompareProductsButton", Model)
                                 @Html.Partial("_ShareButton", Model)
                       
                            </div>
                        </div>

                    </div>



                    
                </div>



                @Html.Widget("productdetails_before_collateral")
                
                <div class="product-collateral">
                    <!--associated products-->
                    <div class="product-variant-list">
                        <div class="row">

                        
                            @foreach (var variant in Model.AssociatedProducts)
                            {
                            
                            
                                <div class=" col-md-5 custom-page-box-div" data-productid="@variant.Id">
                                    @if (!String.IsNullOrWhiteSpace(variant.DefaultPictureModel.ImageUrl))
                                    {
                                        <div class="variant-picture">
                                            <img alt="@variant.DefaultPictureModel.AlternateText" src="@variant.DefaultPictureModel.ImageUrl"
                                                 title="@variant.DefaultPictureModel.Title" id="main-product-img-@variant.Id" />
                                        </div>
                                    }
                                    <div class="variant-overview">
                                        @if (!String.IsNullOrWhiteSpace(variant.Name))
                                        {
                                            <div class="variant-name">
                                                @variant.Name
                                            </div>
                                        }
                                        @if (!String.IsNullOrWhiteSpace(variant.ShortDescription))
                                        {
                                            <div class="variant-description">
                                                @Html.Raw(variant.ShortDescription)
                                            </div>
                                        }
                                        @Html.Partial("_DownloadSample", variant)
                                        
                                        @{
                                            var dataDictAttributes = new ViewDataDictionary();
                                            dataDictAttributes.TemplateInfo.HtmlFieldPrefix = string.Format("attributes_{0}", variant.Id);
                                            @Html.Partial("_ProductAttributes", variant.ProductVariantAttributes, dataDictAttributes)                  
                                        }
                                        <!--product SKU, manufacturer part number, stock info-->
                                        @Html.Partial("_SKU_Man_Stock", variant)
                                        <!--Back in stock subscription-->
                                        @Html.Partial("_BackInStockSubscription", variant)
                                        @{
                                            var dataDictGiftCard = new ViewDataDictionary();
                                            dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = string.Format("giftcard_{0}", variant.Id);
                                            @Html.Partial("_GiftCardInfo", variant.GiftCard, dataDictGiftCard)
                                        }
                                        @{
                                            var dataDictPrice = new ViewDataDictionary();
                                            dataDictPrice.TemplateInfo.HtmlFieldPrefix = string.Format("price_{0}", variant.Id);
                                            @Html.Partial("_ProductPrice", variant.ProductPrice, dataDictPrice)
                                        }
                                        @{
                                            var dataDictAddToCart = new ViewDataDictionary();
                                            dataDictAddToCart.TemplateInfo.HtmlFieldPrefix = string.Format("addtocart_{0}", variant.Id);
                                            @Html.Partial("_AddToCart", variant.AddToCart, dataDictAddToCart)
                                        }
                                         @Html.Partial("_ProductTierPrices", variant.TierPrices)

                                    </div>
                                </div>
                            
                            
                            }
                        </div>

                        
                        @if (Model.AssociatedProducts.Count == 0)
                        {
                            <div class="no-associated-products">
                                @T("Products.NoAssociatedProducts")
                            </div>
                        }
                    </div>

                    <div class="category-tab shop-details-tab"><!--category-tab-->
                        <div class="col-sm-12">
                            <ul class="nav nav-tabs">
                                @if (!String.IsNullOrEmpty(Model.FullDescription))
                                {
                          
                                    <li class="active"><a href="#description" data-toggle="tab">Description</a></li>
                                }
                                @if (!String.IsNullOrEmpty(@Html.Partial("_ProductSpecifications", Model.ProductSpecifications).ToString()))
                                {

                                    <li><a href="#specification" data-toggle="tab">Specifications</a></li>
                                }
                                @if (!String.IsNullOrEmpty(@Html.Partial("_ProductTags", Model.ProductTags).ToString()))
                                {
                                    <li><a href="#tags" data-toggle="tab">Products Tags</a></li>
                                }
                            </ul>
                        </div>
                        <div class="tab-content">
                            @if (!String.IsNullOrEmpty(Model.FullDescription))
                            {
                                <div class="full-description tab-pane fade active in" id="description" itemprop="description">
                                    <div class="custom-page-box-border-less-div">
                                        @Html.Raw(Model.FullDescription)
                                    </div>
                                        
                                </div>

                            }
                            <div class="full-description fade tab-pane" id="specification">
                                <div class="custom-page-box-border-less-div">
                                    @Html.Partial("_ProductSpecifications", Model.ProductSpecifications)
                                </div>

                                
                            </div>

                            <div class="full-description fade tab-pane" id="tags">
                                <div class="custom-page-box-border-less-div">
                                    @Html.Partial("_ProductTags", Model.ProductTags)
                                </div>
                                
                            </div>

                            
							
                        </div>
                    </div>



                    

                </div>
                
            </div>

        }
    </div>
</div>



<div class="product-collateral">
    
      @Html.Action("ProductsAlsoPurchased", "Product", new { productId = Model.Id })
    @Html.Action("RelatedProducts", "Product", new { productId = Model.Id })
</div>

                        